Device and method for encrypting and decrypting a block of data

ABSTRACT

The purpose of this invention is to propose a new encryption method which offers a high level of security combined with a high execution speed. This aim is achieved by a method to encrypt or decrypt blocks of data X to Y, based on a main key R, this method using several serially connected modules, each module using a sub-key RA derived from the main key R and comprising the steps of:  
     inputting at least two initial values X 0 L and X 0 R, and mixing these values to form a mixed value X 1,    
     obtaining a value X 2  by mixing a first part RAH of the sub-key RA with the value X 1,    
     obtaining a value X 3  by applying the value X 2  to a substitution layer, the substitution layer comprising at least one substitution box (sbox), each substitution box containing at least one table of constants for which the input serves as the pointer and the pointed constant serves as the output,  
     obtaining a value X 4  by using a diffusion box of multi-permutation type based on the value X 3,    
     obtaining a value X 5  by mixing a second part RAL of the sub-key RA with the value X 4,    
     obtaining the value X 6  by applying to the value X 5  a substitution layer,  
     obtaining a value X 7  by mixing a first part RAH of the sub-key RA with the value X 6,    
     mixing the value X 7  with the initial at least two values X 0 L and X 0 R to obtain the at least two values X 8 L and X 8 R, X 8 L and X 8 R representing the output value X 8  of the module, this method using at least two modules, where for each module a new sub-key RA is generated from the main key R, the initial values X 0  of the first module being a division of the input data X, the output values X 8 L and X 8 H of the last module forming the output data Y, and this method further comprising the step of applying to at least one of the value X 8 L or X 8 R an orthomorphism function before applying these values to the input X 0 R and X 0 L of the next module.

[0001] The present invention refers to a device and a method for encrypting and decrypting a block of data known as block cipher, the size of the input block and output block being the same.

[0002] This operation is controlled using a key which could either have the same size as the block or could have a different size, generally a larger size.

[0003] This invention refers to a symmetrical encryption/decryption method as opposed to the asymmetrical method. The symmetrical method is characterized by using the same key to encrypt and decrypt the data while the asymmetrical method uses a first key to encrypt and a second key to decrypt the data.

[0004] Well known methods are DES (56 bit key), CAST (128-bit key), Blowfish (448-bit key), Twofish (256-bit key), and Rijndael (also known as AES, 256-bit key). Depending on the applications concerned, they have their own advantage and disadvantage.

[0005] Several patents have been published describing these methods. Patent U.S. Pat. No. 5,214,703 describes the method known as IDEA™ which is based on a 8.5 rounds operations encryption process for 64 bits block length, each round using 6 sub-keys derived from the main key. The core is constituted by a Lai-Massey scheme using addition modulo 2¹⁶, multiplication modulo 2¹⁶+1 and bitwise excusive-OR.

[0006] The two major requirements for an encryption method is the robustness against any form of cryptanalysis and the computational speed. One key factor for the robustness is achieved by the diffusion effect, i.e. when one bit is changed in the input data, all the output bits are influenced in an unpredicted manner.

[0007] The computational speed is mainly determined by the type of mathematical and logical operations needed. More complex operations (division, multiplication) may prolong the time to execute the encryption process.

[0008] The purpose of this invention is to propose a new encryption method which offers a high level of security combined with a high execution speed.

[0009] This aim is achieved by a method to encrypt or decrypt blocks of data X to Y, based on a main key R, this method using several serially connected modules, each module using a sub-key RA derived from the main key R and comprising the steps of:

[0010] inputting at least two initial values X0L and X0R,

[0011] mixing the at least two values X0L and X0R to form a mixed value X1,

[0012] obtaining a value X2 by mixing a first part RAH of the sub-key RA with the value X1,

[0013] obtaining a value X3 by applying the value X2 to a substitution layer, the substitution layer comprising at least one substitution box (sbox), each substitution box containing at least one table of constants for which the input serves as the pointer and the pointed constant serves as the output,

[0014] obtaining a value X4 by using a diffusion box of multi-permutation type based on the value X3,

[0015] obtaining a value X5 by mixing a second part RAL of the sub-key RA with the value X4,

[0016] obtaining the value X6 by applying to the value X5 a substitution layer,

[0017] obtaining a value X7 by mixing a first part RAH of the sub-key RA with the value X6,

[0018] mixing the value X7 with the initial at least two values X0L and X0R to obtain the at least two values X8L and X8R, X8L and X8R representing the output value X8 of the module, this method using at least two modules, where for each module a new sub-key RA is generated from the main key R, the initial values X0 of the first module being a division of the input data X, the output values X8L and X8H of the last module forming the output data Y, and this method further comprising the step of applying to at least one of the value X8L or X8R an orthomorphism function before applying these values to the input X0R and X0L of the next module.

[0019] The two main parts of the method are the substitution layer and the multi-permutation matrix.

[0020] The purpose of the substitution layer is to transform the input value to an output value without a simple algebraic relationship. This is why the quickest way is to use a lookup table containing constants which can achieve the expected confusion result.

[0021] Since in this embodiment the input data has a length of 32 bit, the number of constants will be 2³² values each of 32 bit length.

[0022] According to a preferred embodiment, the input data is split in groups of 8-bit length thus reducing the number of constants to 256 bytes.

[0023] Then the input data of 32 bit or 64 bit is divided in bytes of 8 bit and applied to the substitution box to obtain an output of 8 bit. The input data is used as address pointer and the pointed constant is the output.

[0024] Depending on the implementation method, the constant tables are the same for all groups of the input data (32 bit or 64 bit). In another embodiment, the constant tables are different for each group of the input data.

[0025] The constants stored in this table are a fixed permutation of numbers which are all different, encoded by a number of bits equal to the table width.

[0026] The second main part of the method is the multi-permutation matrix. The multi-permutation matrix is a square matrix with property that every possible square sub-matrix has a determinant different of zero; the elements of the matrix are elements of a finite field. The mixing operation consists in multiplying a vector of input elements by the matrix, resulting in a vector which is defined to be the output.

BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The FIG. 1 shows the block diagram of the main module in the 64 bit version,

[0028] The FIG. 2 shows the main process including an example with two modules

[0029] The FIG. 3 shows the internal part of the main module, in the 64 bit version

[0030] The FIG. 4 shows the block diagram of the main module in the 128 bit version,

[0031] The FIG. 5 shows the block diagram of the orthomorphism function,

[0032] The FIG. 6 shows the sub-system for the generation of the substitution box,

[0033] The FIG. 7 shows the internal part of the main module, in the 128 bit version

[0034] The FIG. 8 shows the main process including an example with two modules in the 128 bit version, and

[0035] The FIG. 9 shows an alternative version of the substitution box.

DETAILED DESCRIPTION OF THE INVENTION

[0036] The FIG. 1 shows the skeleton of the encryption (or decryption) process which represents the module MOD. The entry data X0 of 64 bit, which is represented in two parts X0L and X0R of 32 bit each, are firstly mixed within the mixing element MX to obtain the X1 value. This mixing element aims to provide a 32 bit image of two times 32 bit of data. This could be achieved in different ways such as using X0R function, addition with modulo, or by using any group law.

[0037] The next step is illustrated with the block f32 which has a 32 bit input X1 and a 32 bits output X7 as well as using a sub-key RA. The detailed description of this block is given with reference to FIG. 3 (see below).

[0038] The output X7 of the block f32 is applied to the two mixing blocks MX which are connected with the two entries X0L and X0H.

[0039] The resulting data X8L and X8R represent the two 64 bits output X8 of the module MOD.

[0040] The FIG. 2 shows the whole process using at least two modules MOD. The input data X is first applied to a splitting module SP which convert the 64 bit entry X in two output values X0L1 and X0R1, each of 32-bit length.

[0041] The function of this splitting module SP could be achieved in different ways such as selecting the lowest bits for X0L1 and the highest bits for X0R1, or every odd bit for X0L1 and even bit for X0R1. Other methods of dividing the input data X could be used as long as all the bits of X are comprised in X0L1 and X0R1.

[0042] The outputs X0L1 and X0R1 are then used as entries in the first module MOD1. This first module processes the data while using a first sub-key RA1. The processing for X0L1 and X0R1 is the same as described according to FIG. 1. The outputs of this first module MOD1 are two outputs X8L1 and X8R1. An orthomorphism function is applied to one of these outputs, for example X8L1 as illustrated on FIG. 2. The output resulting from this orthomorphism function is referenced as X0L2. The other value X8R1 resulting from the processing by the first module MOD1 is used as input, as well as the output X0L2 resulting from the orthomorphism function, in a second processing module MOD2. This second module MOD2 will process their input data based on a second sub-key RA2. The outputs of this second module are referenced as X8L2 and X8R2 on FIG. 2. These outputs are assembled to form the encrypted data Y within the assembler module AS. This module AS has the same function as the splitting module SP but works inversely. It is to be noted that the manner to rebuild the output Y could be different than the splitting module SP but the aim remains the same. All bit of X8L2 and X8R2 should be present in the output Y.

[0043] The FIG. 3 shows in detail, the functions of the block f32 of the FIG. 1. In this block, a 32-bits length data X1 is the input. This data are separated in blocks of 8-bit length (X1 a, X1 b, X1 c, X1 d) through a splitting block SPMU, also mentioned X1′ in the FIG. 3. This block has the same function as the one described in respect of the block SP of the FIG. 2. Each of these 8-bit blocks are mixed with a first part RAH of the sub-key RA to obtain a value X2 a, X2 b, X2 c, X2 d (forming the value X2). This mixing operation is the same as the one described in respect with the block MX of the FIG. 1.

[0044] The generation of the two sub-keys RAH and RAL is made through the splitting module SP. This module has the same function as the one described in the FIG. 1.

[0045] Each of these values X2 a to X2 d are applied to a substitution layer, comprising at least one substitution box (sbox), each substitution box containing a table of constants for which the input serves as the pointer and the pointed constant serves as the output. The output data is referenced as X3 a, X3 b, X3 c, X3 d (forming the value X3) on FIG. 3.

[0046] One method to generate this constant table is to use a pseudorandom generator. One should remove all duplicate values so that each constant in this table is unique.

[0047] This data is introduced in a diffusion box Mu4 of (4,4) multi-permutation type. The output data of this diffusion box is referenced as X4 a, X4 b, X4 c, X4 d respectively (forming the value X4). The diffusion box consists in multiplying the input vector (X4 a, X4 b, X4 c, X4 d) by a square matrix 4×4 Mu4, whose elements belong to the finite field with 256 elements; these elements are denoted Mu(i, j), where i refers to the row index and j to the column index. The result of the multiplication of the vector (X4 a, X4 b, X4 c, X4 d) by the matrix Mu4 is a vector (Y4 a, Y4 b, Y4 c, Y4 d) where these values are obtained as follows:

Y 4 a=Mu 4(1, 1)*X 4 a+Mu 4(1, 2)*X 4 b+Mu 4(1, 3)*X 4 c+Mu 4(1, 4)*X 4 d

Y 4 b=Mu 4(2, 1)*X 4 a+Mu 4(2, 2)*X 4 b+Mu 4(2, 3)*X 4 c+Mu 4(2, 4)*X 4 d

Y 4 c=Mu 4(3, 1)*X 4 a+Mu 4(3, 2)*X 4 b+Mu 4(3, 3)*X 4 c+Mu 4(3, 4)*X 4 d

Y 4 d=Mu 4(4, 1)*X 4 a+Mu 4(4, 2)*X 4 b+Mu 4(4, 3)*X 4 c+Mu 4(4, 4)*X 4 d

[0048] Here “+” denotes the addition in the finite field and “*” its multiplication. The elements of Mu4 are chosen such that the amount of computations needed to evaluate the four above expressions is minimal. The number of multiplications by the constant “1” (thereafter denoted “identities”) has therefore been chosen to be as large as possible.

[0049] The data is then mixed with a second part RAL of the sub-key RA to obtain a value X5 a, X5 b, X5 c, X5 d (forming the value X5).

[0050] Each of these values X5 a to X5 d is then applied to a substitution block (sbox) to obtain a value X6 a, X6 b, X6 c, X6 d (forming the value X6). These values are mixed with a first part RAH of the sub-key RA to obtain new values X7 a, X7 b, X7 c, X7 d (forming the value X7).

[0051] Then these values X7 a, X7 b, X7 c, X7 d are assembled to form the output data X7 within the assembler module AS as described in respect with the FIG. 2. This data corresponds to the output data X7 of block f32 in FIG. 1

[0052] During the encryption process, the main key R is divided into several sub-keys, one per module MOD. In the example of the FIG. 3, the first sub-key RA1 in used in combination with the module MOD1 and the second sub-key RA2 is used in combination with the module MOD2.

[0053] To obtain the data X based on the data Y and the key R, the same process as described in the reference to the FIG. 3 is applied with the only difference that the sub-keys are generated in the reverse order. The sub-key RA2 is then applied to the first module MOD1 and the sub-key RA1 is applied to the second module MOD2.

[0054] According to the general principle of this invention, the number of serially connected modules MOD is not limited to two modules. In order to achieve a good robustness, experience has shown that 9 rounds are optimal to obtain a result which could be qualified as an encryption process. This number could be extended to 12 or more in order to obtain more robustness.

[0055] The FIG. 4 describes an embodiment of the module MOD64 designed for processing 128-bit length data. The inputs X0LL and X0LR are mixed together within the mixing element MX to form the output value X1L and in the same manner, the values X0RL and X0RR are mixed together to form the value X1R.

[0056] The next step is illustrated with the layer f64 which has two 32 bits input X1L and X1R and two 32 bits output X7L and X7R as well as using a sub-key RA. The detailed description of this block is given with the reference to FIG. 7 (see below).

[0057] Each of these outputs is mixed with two input data of the module MOD64 within the same mixing element MX. In our example, the output value X7L is mixed with the input X0LL and X0LR respectively and the output value X7R is mixed with the input X0RI and X0RR respectively. Other mixing combination is also possible, such as mixing the output value X7L with X0LL and X0RR in a cross configuration.

[0058] The FIG. 5 is an illustration of an embodiment of the orthomorphism function. The input data is noted ZI and the output data is noted ZO. The data length is not an issue for this function. The input data ZI is first divided into two values ZL and ZR of the same size with the splitting module SP. Then the two values are mixed with the so called MX mixing element and the output of the element is applied to the assembler unit AS. The other split value ZR is directly applied to the assembler module AS without modification. This module comprises two inputs and combines these data to form the output value ZO. This module works inversely than the splitting module SP. The particularity of this embodiment is that the inputs of the assembler module are crossed relative to the outputs of the splitting module SP. The right output ZR of the splitting module SP is applied to the left input of the assembler module AS and the left output ZL of the splitting module SP, after being mixed with the other output of the splitting module SP, is applied to the right input of the assembler module AS.

[0059] As far as the substitution box is concerned, there exist different possibilities to realize this function. We have previously described a method uniquely based on a constant table. The first step to reduce the table size is to split the input and to apply this part to a much smaller table.

[0060] The example of FIG. 3 shows a substitution box working with 8-bit data length thus embedding a table of 256 constants.

[0061] In some cases, in particular where the memory size is an issue, other alternatives are sought. Such alternative is described in reference to the FIGS. 6 and 9.

[0062] The FIG. 3 shows a subsystem Cbox of this substitution box, this subsystem comprising one input C divided into two inputs CL and CR and two outputs CL′ and CR′.

[0063] The heart of this subsystem is the module TA which comprises a constant table of 2^((n/2)) elements, each of n/2 bits, in which n is the length of the input value C.

[0064] For an input having a length of 8 bits, the constant table comprises 16 (2⁴) elements, each of 4-bit length. These elements are randomly generated, taking into account that each element has a unique value.

[0065] The FIG. 9 describes how to use the module Cbox to build a substitution box. The input value CI is firstly split into two parts CL1 and CR1 and applied to the first module Cbox1 as described with reference to FIG. 3. The output of said module Cbox1 is forwarded to the next module Cbox2. One of the outputs of the first module, in this case CL1′, prior to applying to the second module CVBox2, is given to an orthomorphism function OR.

[0066] The execution of the substitution box uses generally at least two subsystems Cbox, each having a different constant table TA. In the illustrated example, the substitution box is made using three subsystems Cbox and the outputs of the last subsystem has no orthomorphism function OR according to the embodiment.

[0067] The FIG. 7 is an alternative of the embodiment described in FIG. 3, designed for data of 64-bit length. The structure designed for 32 bits is largely duplicated to proceed 64-bit of data. The input data X1 is divided into a vector with elements of 8-bit length (X1 a to X1 h) and processed in the same manner as described in respect with the FIG. 3. The main difference is in the diffusion box Mu8 which is a square matrix of 8×8 elements of the finite field with 256 elements. The elements of the matrix are denoted Mu8(i, j), where i refers to row index and j to the column index. For an input vector (X3 a, . . . , X3 h), the multiplication by the matrix Mu8 gives the output vector (Y3 a, . . . , Y3 h) in the following way (“+” is the addition and “*” is the multiplication in the finite field):

Y 3 a=Mu 8(1,1)*X 3 a+Mu 8(1,2)*X 3 b+Mu 8(1,3)*X 3 c+Mu 8(1,4)*X 3 d+Mu 8(1,5)*X 3 e+Mu 8(1,6)*X 3 f+Mu 8(1,7)*X 3 g+Mu 8(1,8)*X 3 h;

Y 3 b=Mu 8(2,1)*X 3 a+Mu 8(2,2)*X 3 b+Mu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four parts, namely X0LL1, X0LR1, X0RL1 and X0RR1 (forming the value X0). Two parts of the result of the module MOD64-1 are then applied to an orthomorphism function OR, before being used as input of the next module MOD64-2.

[0069] The position of the orthomorphism function OR as regard to the outputs of the module MOD64 is not decisive. One can select the two left outputs of the two right outputs depending of the implementation of this method.

[0070] The output Y is directly obtained from the last module MOD64, without having an orthomorphism function OR in one of these outputs.

[0071] In case that more than two modules MOD64 are used, the orthomorphism function OR are placed between each module MOD64. Even if in the preferred embodiment the position of the orthomorphism function OR is the same regardless of the module number, in another embodiment, the position of these orthomorphism function OR can be changed to be connected to a different output of the module MOD64. 

1. Method to encrypt or decrypt blocks of data X to Y, based on a main key R, this method using at least two serially connected main modules (MOD), each main module (MOD) using a sub-key (RA) derived from the main key (R), comprising the steps of: inputting at least two initial values X0L and X0R, mixing the at least two values X0L and X0R to form a mixed value X1, obtaining a value X2 by mixing a first part RAH of the sub-key RA with the value X1, obtaining a value X3 by applying the value X2 to a substitution layer, the substitution layer comprising at least one substitution box (sbox), each substitution box containing a table of constants for which the input serves as the pointer and the pointed constant serves as the output, obtaining a value X4 by using a diffusion box of multi-permutation type based on the value X3, obtaining a value X5 by mixing a second part RAL of the sub-key RA with the value X4, obtaining the value X6 by applying to the value X5 a substitution block, obtaining a value X7 by mixing a first part RAH of the sub-key RA with the value X6, mixing the value X7 with the initial at least two values X0L and X0R to obtain the at least two values X8L and X8R, X8L and X8R representing the output value X8 of the module, where for each main module (MOD) a new sub-key (RA) is generated from the main key (R), the initial values X0L and X0R of the first module being a subset of the input data X, the output values X8L and X8H of the last module forming the output data Y, and this method further comprising the step of applying to at least one of the value X8L or X8R an orthomorphism function before applying these values to the input X0R and X0L of the next main module.
 2. Encryption or decryption method of claim 1, wherein the input data is of 64 bits length and that the input data X is divided into two initial values X0L and X0H of 32 bit length, and the two output values X8L and X8H form the output data Y.
 3. Encryption or decryption method of claim 1, wherein the input data is of 128 bit length and that the input data X is divided in four initial values X0LL, X0LR, X0RL and X0RR of 32 bit length, and the four output values X8LL, X8LR, X8RL and X8RR form the 128 bits output data Y, a first part X1L of the value X1 is obtained by mixing the value X0LL with and X0LR and the second part X1 R of the value X1 is obtained by mixing the value X0RL with X0RR, a first part X7L of the value X7 is mixed with two of the four initial values X0LL, X0LR, X0RL and X0RR and the second part X7R of the value X7 is mixed with the two other parts of the initial values X0LL, X0LR, X0RL and X0RR.
 4. Encryption or decryption method of claim 1, wherein the substitution layer comprises several substitution box (sbox), each box having 8-bit input and 8-bit output, the input of the substitution layer being divided into parts of 8-bit length.
 5. Encryption or decryption method of claim 4, wherein the table of constants (TA) of the substitution box (sbox) contains for a given input a unique output.
 6. Encryption or decryption method of claim 4, wherein the table of constants for each substitution box (sbox) is the same.
 7. Encryption or decryption method of claim 4, wherein the table of constants for each substitution box (sbox) is different.
 8. Encryption or decryption method of claim 4, wherein the table of constants of the substitution box (sbox) is changed at each main module execution.
 9. Encryption or decryption method of claim 1, wherein the data length is 64 bits and the diffusion box is a matrix function Y3=M*X4, the argument M defining 4*4 additions, multiplications by a constant, or identities, of which at least one row and one column comprise three identities.
 10. Encryption or decryption method of claim 9, wherein the remaining rows and remaining columns of the argument M comprise two identities.
 11. Encryption or decryption method of claim 1, wherein the data length is 128 bits and the diffusion box is a matrix function Y3=N*X3, the argument N defining 8*8 additions, multiplications by a constant, or identities, of which at least one row and one column comprise seven identities. 